﻿using System;
using System.Collections.Generic;
using SinBiota.Model.Business.PersistenceServices.Interfaces;
using SinBiota.Model.Entities;
using SinBiota.Model.Persistence.Repositories.Interfaces;

namespace SinBiota.Model.Business.PersistenceServices.Implementation
{
    public class DrainageBasinPersistenceServices : IDrainageBasinPersistenceServices
    {
        private readonly IDrainageBasinRepository _drainageBasinRepository;

        public DrainageBasinPersistenceServices(IDrainageBasinRepository drainageBasinRepository)
        {
            _drainageBasinRepository = drainageBasinRepository;
        }

        public DrainageBasin FindById(int id)
        {
            return _drainageBasinRepository.FindById(id);
        }

        public DrainageBasin FindByName(string name)
        {
            return _drainageBasinRepository.FindByName(name);
        }

        public IList<DrainageBasin> FindByNameLike(string name)
        {
            return _drainageBasinRepository.FindByNameLike(name);
        }

        public IList<DrainageBasin> FindAll()
        {
            return _drainageBasinRepository.FindAll();
        }

        public void Delete(DrainageBasin drainageBasin)
        {
            _drainageBasinRepository.Delete(drainageBasin);
        }

        public void DeleteById(int id)
        {
            Delete(FindById(id));
        }
        public void Save(DrainageBasin drainageBasin)
        {
            _drainageBasinRepository.Save(drainageBasin);
        }

        public void Update(DrainageBasin drainageBasin)
        {
            _drainageBasinRepository.Update(drainageBasin);
        }
    }
}